/**
 * 
 */
package com.sandberg.shopper.core;

/**
 * @author Jesper
 * 
 */
public class Calculator {
	
	public static float calcNormalPrice(float salesPrice, float percent) {
		float normalPrice = (1.0f/(1.0f - percent/100.0f)) * salesPrice;
		return normalPrice;
	}

	public static float calcSalesPrice(float normalPrice, float percent) {
		float salesPrice = normalPrice - (normalPrice * (percent/100.0f));
		return salesPrice;
	}

	public static float calcPercent(float normalPrice, float salesPrice) {
		float percent = (1 - (salesPrice / normalPrice)) * 100.0f;
		return percent;
	}
}
